import 'package:json_annotation/json_annotation.dart';

part 'domain_filter_option_model.g.dart';

@JsonSerializable(explicitToJson: true, includeIfNull: false)
class DomainFilterOptionModel {
  DomainFilterOptionModel(
    this.id,
    this.name,
    this.value,
    this.key,
    this.isSelected,
  );

  @JsonKey(defaultValue: 0)
  int id;
  // 标题
  @JsonKey(defaultValue: '')
  String name;
  @JsonKey(defaultValue: '')
  String value;
  @JsonKey(defaultValue: '')
  String key;
  // 是否选中
  @JsonKey(defaultValue: false)
  bool isSelected;

  factory DomainFilterOptionModel.fromJson(Map<String, dynamic> json) =>
      _$DomainFilterOptionModelFromJson(json);
  Map<String, dynamic> toJson() => _$DomainFilterOptionModelToJson(this);
}
